package controllers;

import java.sql.*;
import org.apache.log4j.Logger;
import play.db.DB;
import play.mvc.*;

//import models.*;

public class Application extends Controller {
    static Logger myLogger = Logger.getLogger(Application.class.getName());

    public static void index() {
        String myDbValue = "didn't work";
        
        try {
            Connection conn;
            ResultSet rs;
            
            conn = DB.getConnection();
            rs = conn.createStatement().executeQuery("select * from testing where id = 0");
            if(rs.next()) {
                myDbValue = rs.getString("testValue");
            }
        }catch (SQLException ex){
            myLogger.error(ex.getMessage());
        }
        
        render(myDbValue);
    }

}